/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       luck_object.h

	$Header: /game/luck_object.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef LUCK_OBJECT_H_INCLUDED
#define LUCK_OBJECT_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "stationary_adventure_object.h"

class t_adventure_ai;
class t_basic_dialog;
class t_creature_array;
class t_creature_stack;

// --------------------------------------------------------------
// object which gives a temporary boost to luck
// --------------------------------------------------------------
class t_luck_object : public t_stationary_adventure_object
{
public:
	t_luck_object( t_stationary_adventure_object const& source, int bonus );

	virtual void        activate_trigger( t_army* army, t_adv_map_point const& point, 
		                                  t_direction direction, t_adventure_frame* frame );
	virtual float		ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;
	virtual std::string get_balloon_help() const;
	virtual int			get_version() const;
	virtual bool        read( std::streambuf&					stream, 
							  t_qualified_adv_object_type const&	type,
							  int								version );
	virtual void		right_click( t_mouse_event const& event,
								     t_adventure_frame* adventure_frame );
	bool                visited( t_army const* army ) const;
	virtual bool        write( std::streambuf& stream ) const;	
protected:
	virtual void add_bonus( t_creature_stack& creature );
	virtual void add_icons( t_basic_dialog* dialog );

	int m_bonus;
};

// --------------------------------------------------------------
// object which gives a temporary boost to morale
// --------------------------------------------------------------
class t_morale_object : public t_luck_object
{
public:
	t_morale_object( t_stationary_adventure_object const& source, int bonus );

	virtual float	ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;

protected:
	virtual void	add_bonus( t_creature_stack& creature );
	virtual void	add_icons( t_basic_dialog* dialog );
};

inline t_morale_object::t_morale_object( t_stationary_adventure_object const& source, int bonus )
                      : t_luck_object( source, bonus )
{
}

// -------------------------------------------------------
// blattner stone: gives +1 luck and +1 morale
// -------------------------------------------------------
class t_adv_blattner_stone : public t_luck_object
{
public:
	t_adv_blattner_stone( t_stationary_adventure_object const& source );

	virtual float		ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;

protected:
	virtual void		add_bonus( t_creature_stack& creature );
	virtual void		add_icons( t_basic_dialog* dialog );
};

inline t_adv_blattner_stone::t_adv_blattner_stone( t_stationary_adventure_object const& source )
                      : t_luck_object( source, 1 )
{
}

// -------------------------------------------------------
// object which gives either +1 luck or +1 morale
// -------------------------------------------------------
class t_adv_idol_of_fortune : public t_luck_object
{
public:
	t_adv_idol_of_fortune( t_stationary_adventure_object const& source );

	virtual void activate_trigger( t_army* army, t_adv_map_point const& point, 
		                           t_direction direction, t_adventure_frame* frame );

	virtual float		ai_value( t_adventure_ai const& ai, t_creature_array const& army, int move_cost ) const;

protected:
	virtual void add_bonus( t_creature_stack& creature );
	virtual void add_icons( t_basic_dialog* dialog );

	bool m_give_luck;
};

inline t_adv_idol_of_fortune::t_adv_idol_of_fortune( t_stationary_adventure_object const& source )
                      : t_luck_object( source, 1 )
{
}

#endif // LUCK_OBJECT_H_INCLUDED